package com.xhlj.socket;

public enum MessageEnmu {
    /*用户名*/
    TOPIC_USERNAME(1),
    /*
    * TOPIC_COMMENT_INSERT:创建评论
    * */
    TOPIC_COMMENT_INSERT(2),
    /*
    * TOPIC_GET_List:获取未读评论列表,以及总厨
    * "reply:comment:list"
    * */
    TOPIC_GET_List(3),
    /*
    *
    * reply:comment:read
    * */
    TOPIC_COMMENT_READ(4);
    private final int value;

    MessageEnmu(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    /*将int转化为对应的enum*/
    public static MessageEnmu fromValue(int value) {
        for (MessageEnmu messageEnmu : MessageEnmu.values()) {
            if (messageEnmu.getValue() == value) {
                return messageEnmu;
            }
        }
        throw new IllegalArgumentException("Invalid value for UserType: " + value);
    }
}
